package com.tjetc.view.impl;

import com.tjetc.pojo.dto.CheckInDTO;
import com.tjetc.utils.ScannerUtils;
import com.tjetc.view.CommonPage;

/**
 * @Author: itda
 * @Date: 2024/5/11 19:37
 * @Description: CommonPageImpl
 */
public class CommonPageImpl implements CommonPage {
    @Override
    public Long getByHotelId() {
        System.out.println("请输入酒店id");
        return ScannerUtils.sc.nextLong();
    }

    @Override
    public CheckInDTO checkIn() {
        System.out.println("请输入要入住的酒店id：");
        long hotelId = ScannerUtils.sc.nextLong();
        System.out.println("请输入要入住的房间id：");
        long roomId = ScannerUtils.sc.nextLong();
        System.out.println("请输入要入住的预订人id：");
        long guestId = ScannerUtils.sc.nextLong();
        return CheckInDTO.builder().hotelId(hotelId).roomId(roomId).guestId(guestId).build();
    }

    @Override
    public CheckInDTO checkOut() {
        System.out.println("请输入要退房的酒店id：");
        long hotelId = ScannerUtils.sc.nextLong();
        System.out.println("请输入要退房的房间id：");
        long roomId = ScannerUtils.sc.nextLong();
        System.out.println("请输入要退房的预订人id：");
        long guestId = ScannerUtils.sc.nextLong();
        return CheckInDTO.builder().hotelId(hotelId).roomId(roomId).guestId(guestId).build();
    }
}
